function fn<T>(a: T): T {
    return a;
}

fn<string>('Tom');

function fn2<T, K>(a: T, b: K): T {
    console.log(b);
    return a;
}

fn2<string, number>('Tom', 18);

interface inter {
    name: string;
}

function fn3<T extends inter>(a: T): T {
    return a;
}

fn3<inter>({name: 'Tom'});

class MyClass<T> {
    private _name: T;

    constructor(name: T) {
        this._name = name
    }

    sayHello() {
        console.log(this._name);
    }

    set name(value: T) {
        this._name = value;
    }

    get name() {
        return this._name;
    }
}